<?php echo $html->script("lib/jquery.datepicker.min.js");?>
<?php echo $html->css("screen/jquery.datepicker.css");?>
<?php echo $html->css("screen/stocklist.css");?>
<?php echo $html->css("screen/press_admin.css");?>
<script type="text/javascript">
$(document).ready(function(){
try{
	$("#PressEditstatusForm").validate({
		rules: {
			'data[Press][buy_price]': {
				required: true,
				numberDE:true
			},
			'data[Press][sell_price]': {
				required: true,
				numberDE:true
			},
			'data[Press][available_from_date]': {
				required: true,
				formatDate:true
			},
			'data[Press][first_off_date]': {
				required: true,
				formatDate:true
			},
			'data[Press][sell_price]': {
				required: true,
				numberDE:true
			}
			
		},
		messages: {
		}
	});
	$.validator.addMethod(
		"formatDate",
		function(value, element) {			
			return value.match(/^\d\d\d\d?-\d\d?-\d\d$/);
		},
		"Please enter a date in the format yyyy-mm-dd"
	);
	$(".datepicker" ).datepicker({
		"dateFormat": "yy-mm-dd",		
		onClose: function(dateText, inst) {
			if ($('#PressFirstOffDateMonth').val()!='')$('#datechose_overlay2').hide();
			if ($('#AvailableFromDate').val()!='')$('#datechose_overlay1').hide();
		}
	});
	$('.jqTransform').jqTransform({width:100});
}catch(e){
	alert(e);
}
});
</script>
<?php echo $this->element('menu', array("active" => "3.a"));?>
<ul class="breadcrumb">
        <li>
          <?php echo $this->Html->link(__('Press  ', true), array('action' => 'index'), array('class'=>'fist_link'));?>
        </li>
        <li>
          <a href="#" >Edit Status Press  </a>
        </li>
        <li>
          <a href="#" ><?php echo $this->data['Press']['name']?></a>
        </li>
</ul>	
<div id="content" class="stocklist_form presses">
	<div class="flash_message">
		<h2><?php echo $session->read('Message.flash.message')?></h2>
	</div>
	<?php echo $this->Form->create('Press',array('action' => 'editstatus','class'=>'form_status'));?>
		<?php echo $this->Form->hidden('id'); ?>
		<table>
		<tr>
			<td colspan="2">		
		<span class="jqTransform level13"><?php echo $this->Form->input('status_id'); ?></span>
		<div style="clear:left"></div>
		<?php echo $this->Form->input('buy_price',array('label'=>'Buy Price ($)')); ?>
		<?php echo $this->Form->input('sell_price',array('label'=>'Sell Price ($)')); ?>
		<span class="jqTransform level12"><?php echo $this->Form->input('sell_type_id'); ?></span>		
		<div style="clear:left"></div>
		<div class="input datetime">
			<label for="AvailableFromDate">Available From Date</label>
			<div onclick="this.style.display='none';$('#AvailableFromDate').focus();" id="datechose_overlay1" class="overlay"></div>
			<input onblur="if ($(this).val()=='')$('#datechose_overlay1').show();" class="datepicker" id="AvailableFromDate" name="data[Press][available_from_date]" value="<?php echo substr($this->data['Press']['available_from_date'],0,10); ?>" type="text" />
		</div>
		<div style="clear:left"></div>
		<div class="input datetime">
			<label for="PressFirstOffDateMonth">First Off Date</label>
			<div onclick="this.style.display='none';$('#PressFirstOffDateMonth').focus();" id="datechose_overlay2" class="overlay"></div>
			<input onblur="if ($(this).val()=='')$('#datechose_overlay2').show();" class="datepicker" id="PressFirstOffDateMonth" name="data[Press][first_off_date]" value="<?php echo substr($this->data['Press']['first_off_date'],0,10); ?>" type="text" />
		</div>
		<span class="jqTransform level11"><?php echo $this->Form->input('condition'); ?></span>
		<span class="jqTransform"><?php echo $this->Form->input('countries_id',array('label'=>'Location','name'=>'data[Press][location]')); ?></span>				
		<div style="clear:left"></div>
		</td></tr>
		<tr>
			<td colspan="2">			
				<?php echo $this->Form->input('active'); ?>
			</td>
		</tr>
		<tr>
			<td class="firsttd"></td><td>		
				<div class="clear">
		<?php echo $form->submit(__('Save', true),array('class'=>'bt','div'=>false));?>
	</div>	 
	</td></tr>
	</table>	
		<?php echo $form->end();?>
	</div>